package com.stock.demo.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.stock.demo.R;
import com.stock.demo.adapter.viewholder.StockViewHolder;
import com.stock.demo.function.home.view.LiveBroadcastDetailActivity;
import com.stock.demo.function.home.view.LiveBroadcastTypeFragment;
import com.stock.demo.model.LiveBroadcastBean;

import java.util.ArrayList;

/**
 * Created by xuzhaoyu on 17-7-31.
 */

public class LiveBroadcastAdapter extends StockBaseAdapter<LiveBroadcastBean> {

    private LiveBroadcastTypeFragment.LiveType mType;
    private Context mContext;

    public LiveBroadcastAdapter(Context context, ArrayList<LiveBroadcastBean> data, LiveBroadcastTypeFragment.LiveType type) {
        super(context, data);
        mContext = context;
        mType = type;
    }

    @Override
    public int setLayoutResId() {
        return R.layout.view_live_broadcast_item;
    }

    @Override
    public void onBindViewHolder(StockViewHolder holder, int position) {
        TextView tvTitle = (TextView) holder.itemView.findViewById(R.id.tv_live_broadcast_item_title);
        tvTitle.setText("股海实战之价量分析" + "=" + mType);
        holder.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                LiveBroadcastDetailActivity.startAction(mContext);
            }
        });
    }
}
